// pages/personal/index.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        swiperCurrent: 0,
        indicatorDots: true,
        autoplay: true,
        interval: 3000,
        duration: 800,
        searchVal: '',
        circular: true,
        indicatorCo: "#ffdfdc",
        indicatoraAC: "#ff948a",
        txtlist: [
            '独库公路火热进行中',
            '伊昭公路火热进行中',
            '独库公路火热进行中'
        ],
        imgUrls: [
            'image/banner1.jpg',
            'image/banner2.jpg',
            'image/banner3.jpg'
        ],
        links: [
            '../user/user',
            '../user/user',
            '../user/user'
        ],
        spot: [
            {
                src: 'image/picture.jpg',
                text: '红光山旅游景区',
                distance: '5km',
                money: '199'
            },
            {
                src: 'image/picture.jpg',
                text: '红光山旅游景区',
                distance: '5km',
                money: '199'
            },
            {
                src: 'image/picture.jpg',
                text: '红光山旅游景区',
                distance: '5km',
                money: '199'
            },
            {
                src: 'image/picture.jpg',
                text: '红光山旅游景区',
                distance: '5km',
                money: '199'
            }
        ],
        navFor: [
            {
                src: 'image/nav-icon1.png',
                text: '主题活动'
            },
            {
                src: 'image/nav-icon2.png',
                text: '旅游攻略'
            },
            {
                src: 'image/nav-icon3.png',
                text: '语音导览'
            },
            {
                src: 'image/nav-icon4.png',
                text: '旅行社'
            },
            {
                src: 'image/nav-icon5.png',
                text: '热门景点'
            },
            {
                src: 'image/nav-icon6.png',
                text: '旅游线路'
            },
            {
                src: 'image/nav-icon7.png',
                text: '餐饮美食'
            },
            {
                src: 'image/nav-icon8.png',
                text: '酒店客房'
            }
            // {
            //     src: 'image/nav-icon1.png',
            //     text: 'test1'
            // },
            // {
            //     src: 'image/nav-icon2.png',
            //     text: 'test1'
            // },
            // {
            //     src: 'image/nav-icon3.png',
            //     text: 'test1'
            // },
            // {
            //     src: 'image/nav-icon4.png',
            //     text: 'test1'
            // },
            // {
            //     src: 'image/nav-icon5.png',
            //     text: 'test1'
            // },
            // {
            //     src: 'image/nav-icon6.png',
            //     text: 'test1'
            // },
            // {
            //     src: 'image/nav-icon7.png',
            //     text: 'test1'
            // },
            // {
            //     src: 'image/nav-icon8.png',
            //     text: 'test1'
            // }
        ]
    },
    bindNav: function (event) {
        var index = event.currentTarget.dataset.index
        console.log(index)
    
        if (index == 0) {
            // wx.navigateTo({
            //     url: '../themeActivities/index'
            // })
            wx.showToast({
                title: '正在开发,稍安勿躁',
                icon: 'loading',
                image: '',
                duration: 1500,
                mask: false,
                success: (result)=>{
                    
                }
            });
        } else if (index == 1) {
            // wx.navigateTo({
            //     url: '../tourismStrategy/index'
            // })
            wx.showToast({
                title: '正在开发,稍安勿躁',
                icon: 'loading',
                image: '',
                duration: 1500,
                mask: false,
                success: (result)=>{
                    
                }
            });
        } else if (index == 2) {
            // wx.navigateTo({
            //     // url: '../speech/index'
            //     url: '../information/index'
            // })
            wx.showToast({
                title: '正在开发,稍安勿躁',
                icon: 'loading',
                image: '',
                duration: 1500,
                mask: false,
                success: (result)=>{
                    
                }
            });
        } else if (index == 3) {
            wx.navigateTo({
                // url: '../information/index'
                url: '../travelAgency/index'
            })
        } else if (index == 4) {
            wx.navigateTo({
                // url: '../spot/index',
                url:'../spotList/spotList/index'
            })
        } else if (index == 5) {
            // wx.navigateTo({
            //     url: '../tourism/index'
            // })
            wx.showToast({
                title: '正在开发,稍安勿躁',
                icon: 'loading',
                image: '',
                duration: 1500,
                mask: false,
                success: (result)=>{
                    
                }
            });
        } else if (index == 6) {
            // wx.navigateTo({
            //     url: '../cate/index'
            // })
            wx.showToast({
                title: '正在开发,稍安勿躁',
                icon: 'loading',
                image: '',
                duration: 1500,
                mask: false,
                success: (result)=>{
                    
                }
            });
        } else if (index == 7) {
            // wx.navigateTo({
            //     url: '../tavern/index'
            // })
            wx.showToast({
                title: '正在开发,稍安勿躁',
                icon: 'loading',
                image: '',
                duration: 1500,
                mask: false,
                success: (result)=>{
                    
                }
            });
        } else {
            wx.showToast({
                title: '正在开发中',
                icon: 'loading',
                duration: 2000
            })
        }
    },
    onDeveloping(e){
        
    },
    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {

    },

    swiperChange: function (e) {
        this.setData({
            swiperCurrent: e.detail.current
        })
    },
    goSeeMore: function (e) {
        let query = e.currentTarget.dataset['type']
        console.log(query)
        if (query == 'tuijian') {
            wx.navigateTo({
                url: 'more/more'
            });
        }
    },
    goToHotRoute(e){
        let name = e.currentTarget.dataset['name']
        wx.navigateTo({
            url:`../hotRoute/hotRoute?name=${name}`
        })
    },
    goToHotSpots(e){
        let name = e.currentTarget.dataset['name']
        wx.navigateTo({
            url:`../hotSpots/hotSpots?name=${name}`
        })
    },
    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function () {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function () {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function () {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function () {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function () {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function () {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function () {

    }
})
